<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--thymeleaf语法标签-->
<span th:text="${msg}"></span>
<hr>
<span th:if="${sex} =='男'">男</span>
<hr>
<span th:if="${sex }=='女'">女</span>
<hr>
<!--th:value 绑定属性值-->
<input type="text" name="username" th:value="${msg}"/>
<hr>
<input type="text" name="username" th:value="${#strings.substring(msg,0,6)}"/>
<hr>
<input type="text" name="birth" th:value="${#dates.format(birth,'yyyy-MM-dd')}"/>
<hr>

项目根目录：<a th:href="@{/}">@{/}</a>
服务器目录：<a th:href="@{~/}">@{~/}</a>
</body>
</html>